
import numpy as np
import cv2 as cv

colcor_gray = [36,217,110]
# np.full 创建一个8*8 的三通道数组，每个通道分别设置为 36,217,110
img = np.full((16, 16, 3), colcor_gray , dtype=np.uint8)
cv.line(img, (0,0), (15,0), (255,0,0), 1)   # 画直线, 做旋转标记
cv.imshow('1_origin_img',img)
# cv.waitKey(0)

# 旋转图片
(h,w) = img.shape[:2]
center = (w//2,h//2)
M = cv.getRotationMatrix2D(center, 45, 1.0)
rotated = cv.warpAffine(img, M, (w,h))
cv.imshow('2_rotated_img',rotated)
cv.waitKey(0)

cv.destroyAllWindows()